package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by LN on 2017/7/24.10:33
 */
@Entity
@Table(name = "coupon_detail")
public class CouponDetailEntity extends BaseEntity {
    public enum CouponDetailEntity_{
        couponNo,sta
    }
    private String couponCode;
    private String couponNo;
    private String openid;
    private Date ownDate;
    private String sta;
    private BigDecimal salePrice;
    private String saleType;
    private String saleUser;
    private Date validFromDate;
    private Date validToDate;
    private Date giveEndDate;
    private Date fromDate;
    private String fromUser;
    private String remark;
    private String orderNo;
    private String memberNo;

    @Basic
    @Column(name = "coupon_code")
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    @Basic
    @Column(name = "coupon_no")
    public String getCouponNo() {
        return couponNo;
    }

    public void setCouponNo(String couponNo) {
        this.couponNo = couponNo;
    }

    @Basic
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "own_date")
    public Date getOwnDate() {
        return ownDate;
    }

    public void setOwnDate(Date ownDate) {
        this.ownDate = ownDate;
    }

    @Basic
    @Column(name = "sta")
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Basic
    @Column(name = "sale_price")
    public BigDecimal getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    @Basic
    @Column(name = "sale_type")
    public String getSaleType() {
        return saleType;
    }

    public void setSaleType(String saleType) {
        this.saleType = saleType;
    }

    @Basic
    @Column(name = "sale_user")
    public String getSaleUser() {
        return saleUser;
    }

    public void setSaleUser(String saleUser) {
        this.saleUser = saleUser;
    }

    @Basic
    @Column(name = "valid_from_date")
    public Date getValidFromDate() {
        return validFromDate;
    }

    public void setValidFromDate(Date validFromDate) {
        this.validFromDate = validFromDate;
    }

    @Basic
    @Column(name = "valid_to_date")
    public Date getValidToDate() {
        return validToDate;
    }

    public void setValidToDate(Date validToDate) {
        this.validToDate = validToDate;
    }

    @Basic
    @Column(name = "give_end_date")
    public Date getGiveEndDate() {
        return giveEndDate;
    }

    public void setGiveEndDate(Date giveEndDate) {
        this.giveEndDate = giveEndDate;
    }

    @Basic
    @Column(name = "from_date")
    public Date getFromDate() {
        return fromDate;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    @Basic
    @Column(name = "from_user")
    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser) {
        this.fromUser = fromUser;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    @Basic
    @Column(name = "member_no")
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponDetailEntity that = (CouponDetailEntity) o;

        if (couponCode != null ? !couponCode.equals(that.couponCode) : that.couponCode != null) return false;
        if (couponNo != null ? !couponNo.equals(that.couponNo) : that.couponNo != null) return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (ownDate != null ? !ownDate.equals(that.ownDate) : that.ownDate != null) return false;
        if (sta != null ? !sta.equals(that.sta) : that.sta != null) return false;
        if (salePrice != null ? !salePrice.equals(that.salePrice) : that.salePrice != null) return false;
        if (saleType != null ? !saleType.equals(that.saleType) : that.saleType != null) return false;
        if (saleUser != null ? !saleUser.equals(that.saleUser) : that.saleUser != null) return false;
        if (validFromDate != null ? !validFromDate.equals(that.validFromDate) : that.validFromDate != null)
            return false;
        if (validToDate != null ? !validToDate.equals(that.validToDate) : that.validToDate != null) return false;
        if (giveEndDate != null ? !giveEndDate.equals(that.giveEndDate) : that.giveEndDate != null) return false;
        if (fromDate != null ? !fromDate.equals(that.fromDate) : that.fromDate != null) return false;
        if (fromUser != null ? !fromUser.equals(that.fromUser) : that.fromUser != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (orderNo != null ? !orderNo.equals(that.orderNo) : that.orderNo != null) return false;
        return memberNo != null ? memberNo.equals(that.memberNo) : that.memberNo == null;
    }

    @Override
    public int hashCode() {
        int result = couponCode != null ? couponCode.hashCode() : 0;
        result = 31 * result + (couponNo != null ? couponNo.hashCode() : 0);
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (ownDate != null ? ownDate.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (salePrice != null ? salePrice.hashCode() : 0);
        result = 31 * result + (saleType != null ? saleType.hashCode() : 0);
        result = 31 * result + (saleUser != null ? saleUser.hashCode() : 0);
        result = 31 * result + (validFromDate != null ? validFromDate.hashCode() : 0);
        result = 31 * result + (validToDate != null ? validToDate.hashCode() : 0);
        result = 31 * result + (giveEndDate != null ? giveEndDate.hashCode() : 0);
        result = 31 * result + (fromDate != null ? fromDate.hashCode() : 0);
        result = 31 * result + (fromUser != null ? fromUser.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        return result;
    }
}
